<?php
namespace app\index\model;
use think\Model;

class Comment extends Model{

    public function getCommentData($id)
    {
        $c = new Comment();
        $comment = $c->with('user')->where('art_id',$id)->select();
        return $comment;
    }

    public function user()
    {

        return $this->hasOne('User','user_id','username');
    }

}



